<?php 
    include_once('../includes/common.inc.php');
    include_once("../dal/orderDAL.php");
    if(isset($_GET["orderId_array"]))
    {
        $count = count($_GET['orderId_array']);
        for ($i=0; $i<$count; $i++){ 
            $orderId_array[$i] = $_GET['orderId_array'][$i];
        }
        $orderDAL = new OrderDAL();
        $count = $orderDAL->deleteOrders($orderId_array);
        if($count > 0)
        {
            header("Location:index.php?message=Bạn đã delete " . $count . " đơn hàng thành công");
        }
        else
        {
            header("Location:index.php?error_message=Delete đơn hàng thất bại");
        }
    }
    
?>